<template>
  <li class="hot-list" @click="golist(hotlistArr.pid)">
    <div class="list">
      <div class="title">
        <div class="name">
          <span class="name-trade">{{ hotlistArr.name }}</span>
          <span v-show="showPrice" class="price">&yen;{{ hotlistArr.price }}</span>
        </div>
        <div class="details-text">
          
            {{ hotlistArr.desc | formatDesc }}
          
        </div>
      </div>
      <div class="pic">
        <img class="autoImg" :src="hotlistArr.smallImg" />
      </div>
    </div>
  </li>
</template>
<script>
import "../assets/less/hotlist.less";
export default {
  name: "Hotlist",
  props: {
    showPrice:{
      type:Boolean,
      default(){
        return true
      }
    },
    hotlistArr: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  methods: {
    golist(pid){
      this.$router.push({name:'Details',params:{pid}})
      
    }
  },
  filters: {
    formatDesc(val) {
        let arr =  val.split(/\n/);
        return arr[0]
    },
  },
};
</script>